﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

 

public partial class Frame_frmCModuleList : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //this.hidpmref.Value = Request["pmref"] != null ? Request["pmref"].ToString() : "";

            //Roles.SystemOption sysOption = new Roles.SystemOption();
            //hidPageCount.Value = sysOption.GetPageSize().ToString();
            //LoadPmodule();
        }
    }

    public void LoadPmodule()
    {
        //string strError = string.Empty;
        //ModuleBL moduleBL = new ModuleBL();

        //List<CMODULE> groupList = moduleBL.GetCModuleByPmref(this.hidpmref.Value);
        //this.grdPModule.DataSource = groupList;
        //grdPModule.PageSize = int.Parse(hidPageCount.Value);

        //grdPModule.DataBind();

        
        //if (groupList == null)
        //{
        //    lblDataCount.Text = "共有0条记录。";
        //}
        //else
        //{
        //    lblDataCount.Text = "共有" + groupList.Count.ToString() + "条记录。";
        //    //groupList.Count().ToString();
        //}
    }
    protected void btnBack_Click(object sender, EventArgs e)
    {
        Response.Redirect("frmPModuleList.aspx");
    }

    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Response.Redirect("frmCModuleDetail.aspx?pmref=" + hidpmref.Value );
    }
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        LinkButton linkBtn = sender as LinkButton;
        Response.Redirect("frmCModuleDetail.aspx?cmref=" + linkBtn.CommandArgument.ToString() + "&pmref=" + hidpmref.Value);
    }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        //LinkButton linkBtn = sender as LinkButton;
        //string cmref = linkBtn.CommandArgument.ToString();
        //try
        //{
        //    string strErrMessage = string.Empty;
        //    ModuleBL moduleBL = new ModuleBL();
        //    if (moduleBL.DeleteCModule(cmref))
        //    {
        //        lblMessage.ForeColor = System.Drawing.Color.Green;
        //        lblMessage.Text = " 删除成功。";
        //    }

        //    else
        //    {
        //        lblMessage.Text = "保存失败。";
        //    }
        //    LoadPmodule();
        //}
        //catch
        //{
        //    this.lblMessage.Text = "连接数据库失败。";

        //}
    }
}
